home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-04 | 41.4 KB | 1,131 lines |
- C.S.M.P. Digest Mon, 04 May 92 Volume 1 : Issue 71
-
- Today's Topics:
-
- Memory management
- In MPW C, how do you cure a Jump Table Offset is out of range error?
- Passwords with ModalDialog
- Launch App & Doc
- Increasing an application's heap size
- No, I'm Not Programming Graphics & Sound, I'm Playing
- MPW shell script parameter manipulation
- SUMMARY: Hotels in San Jose / WWDC in May
- Dialog/Think C Questions
-
-
- The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
-
- These digests are available (by using FTP, account anonymous, your email
- address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
- edu. This is also the home of the comp.sys.mac.programmer Frequently Asked
- Questions list. The last several issues of the digest are available from
- sumex-aim.stanford.edu as well.
-
- These digests are also available via email. Just send a note saying that you
- want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
- automatically receive each new digest as it is created.
-
- The articles in these digests are taken directly from comp.sys.mac.programmer.
- They are not edited; all articles included in this digest are in their original
- posted form. The only articles that are -not- included in these digests are
- those which didn't receive any replies (except those that give information
- rather than ask a question). All replies to each article are concatenated
- onto the original article in the order in which they were received. Article
- threads are not added to the digests until the last article added to the
- thread is at least one month old (this is to ensure that the thread is dead
- before adding it to the digests).
-
- Send administrative mail to mkelly@cs.uoregon.edu.
-
- -------------------------------------------------------
-
- From: kallman@idicl1.idi.battelle.org
- Subject: Memory management
- Date: 10 Mar 92 16:19:14 GMT
- Organization: IDI-Dublin
-
- I need to develop a generic memory allocation routine, which would emulate
- the C-RTL function malloc() and return a pointer to a location in memory,
- but I would like to do this using the Memory Manager routines
-
- Furthermore, I would like to be able to allocate this chunk of memory using
- NewHandle(), move this into high memory, and then lock it. My question is,
- what is the appropriate way to return a pointer to this block in high
- memory?
-
- Any help would be greatly appreciated.
-
- Joel
-
- BTW, I'm doing this in Think C 5.0 and their implementation of malloc()
- doesn't satisfy my requirements.
-
- +++++++++++++++++++++++++++
-
- From: e-sink@uiuc.edu (Eric W. Sink)
- Organization: University of Illinois at Urbana-Champaign
- Date: Wed, 11 Mar 1992 14:56:03 GMT
-
- In <1992Mar10.111914.1@idicl1.idi.battelle.org> kallman@idicl1.idi.battelle.org writes:
-
- >I need to develop a generic memory allocation routine, which would emulate
- >the C-RTL function malloc() and return a pointer to a location in memory,
- >but I would like to do this using the Memory Manager routines
-
- >Furthermore, I would like to be able to allocate this chunk of memory using
- >NewHandle(), move this into high memory, and then lock it. My question is,
- >what is the appropriate way to return a pointer to this block in high
- >memory?
-
- Not too difficult.
-
- Handle h;
- h = NewHandle(SIZE);
- MoveHHi(h);
- HLock(h);
- return *h;
-
- BTW, take a quick peek at the malloc() written by Tim Endres. You can
- get it by anon ftp from harvest.cecer.army.mil in pub/mac/src. Let me
- know if it suits your needs.
-
- - --
- Eric W. Sink, Spatial Analysis and Systems Team
- USACERL, P.O. Box 9005, Champaign, IL 61826-9005
- 1-800-USA-CERL x449, e-sink@uiuc.edu
-
- +++++++++++++++++++++++++++
-
- From: REEKES@applelink.apple.com (Jim Reekes)
- Date: 20 Mar 92 20:08:56 GMT
- Organization: Apple Computer, Inc.
-
- In article <1992Mar11.145603.14782@sunb10.cs.uiuc.edu>, e-sink@uiuc.edu (Eric W. Sink) writes:
- >
- > In <1992Mar10.111914.1@idicl1.idi.battelle.org> kallman@idicl1.idi.battelle.org writes:
- >
- > >I need to develop a generic memory allocation routine, which would emulate
- > >the C-RTL function malloc() and return a pointer to a location in memory,
- > >but I would like to do this using the Memory Manager routines
- >
- > >Furthermore, I would like to be able to allocate this chunk of memory using
- > >NewHandle(), move this into high memory, and then lock it. My question is,
- > >what is the appropriate way to return a pointer to this block in high
- > >memory?
- >
- > Not too difficult.
- >
- > Handle h;
- > h = NewHandle(SIZE);
- > MoveHHi(h);
- > HLock(h);
- > return *h;
-
- If you're just going to keep the memory locked, then use NewPtr. Handles
- are suppose to be relocatable. You move them high for temporaray reasons.
- MoveHHi will lead you to fragmentation problems. So, for a malloc routine
- I would recommend NewPtr. But honestly, I wouldn't use malloc for anything
- designed to run on a Macintosh.
-
-
- - -----------------------------------------------------------------------
- Jim Reekes, E.O. | Macintosh Toolbox Engineering
- | Sound Manager Expert
- Apple Computer, Inc. | "All opinions expressed are mine, and do
- 20525 Mariani Ave. MS: 81-KS | not necessarily represent those of my
- Cupertino, CA 95014 | employer, Apple Computer Inc."
-
- +++++++++++++++++++++++++++
-
- From: brunner@brchh87.bnr.ca (James Brunner)
- Date: 23 Mar 92 20:13:45 GMT
-
- In article <1992Mar10.111914.1@idicl1.idi.battelle.org>, kallman@idicl1.idi.battelle.org writes:
- |> I need to develop a generic memory allocation routine, which would emulate
- |> the C-RTL function malloc() and return a pointer to a location in memory,
- |> but I would like to do this using the Memory Manager routines
- |>
- |> Furthermore, I would like to be able to allocate this chunk of memory using
- |> NewHandle(), move this into high memory, and then lock it. My question is,
- |> what is the appropriate way to return a pointer to this block in high
- |> memory?
-
- What's the point??? I mean why whould you want to allocate a relocatable
- block, move it to a fixed location, and permanently lock it?
-
- Just use NewPtr. Allocate a fixed block (that's what you want anyway).
- NewPtr automagically allocates the block in high (or is it low) memory.
- Return pointers to smaller blocks in one (or several) large fixed blocks.
- - --
- - ---------------------------------------------------------------------------
- Jim Brunner - (brunner@brchh87.BNR.CA)
- All opinions are my own and have nothing whatsoever to do with BNR, NT,
- NTI, Bell Canada, or any of the BCE corporations or affiliates.
-
- +++++++++++++++++++++++++++
-
- From: lsr@taligent.com (Larry Rosenstein)
- Date: 2 Apr 92 01:30:58 GMT
- Organization: Taligent, Inc.
-
- In article <7148@brchh104.bnr.ca>, brunner@brchh87.bnr.ca (James Brunner)
- writes:
- >
- > What's the point??? I mean why whould you want to allocate a relocatable
- > block, move it to a fixed location, and permanently lock it?
- >
- > Just use NewPtr. Allocate a fixed block (that's what you want anyway).
- > NewPtr automagically allocates the block in high (or is it low) memory.
-
- NewPtr puts the block as low as possible, which makes it much slower than if you
- call NewHandle and lock the handle. Which approach to take depends on how you
- are using the memory, and what else your program does.
- - --
- Larry Rosenstein
- Taligent, Inc.
- lsr@taligent.com
-
- ---------------------------
-
- From: Haydn Huntley <huntley@garbo.cs.indiana.edu>
- Subject: In MPW C, how do you cure a Jump Table Offset is out of range error?
- Organization: Indiana University, Bloomington
- Date: Mon, 23 Mar 1992 23:40:50 -0500
-
-
- I'm trying to compile the GNU version of the M4 macro processor for
- MPW C as an MPW tool, and I've gotten all of the files to compile, but
- I can't get them to link, because I keep getting "Error: Jump Table
- Offset is out of range". Can anyone help me?
-
- BTW, I'm using MPW 3.0, rather than the latest version, if that makes
- a difference. Any and *all* help will be *greatly* appreciated! :-)
-
- - --Haydn
-
- Here's the link command and the results:
-
- Link -w -c 'MPS ' -t MPST -p -ss 500000 <del>
- :ObjFolder:m4.c.o :ObjFolder:input.c.o :ObjFolder:output.c.o <del>
- :ObjFolder:symtab.c.o :ObjFolder:builtin.c.o :ObjFolder:macro.c.o <del>
- :ObjFolder:debug.c.o :ObjFolder:eval.c.o :ObjFolder:path.c.o <del>
- :ObjFolder:format.c.o :ObjFolder:regex.c.o :ObjFolder:obstack.c.o <del>
- :ObjFolder:getopt.c.o :ObjFolder:getopt1.c.o <del>
- :ObjFolder:alloca.c.o <del>
- -sn STDIO=Main <del>
- -sn INTENV=Main <del>
- -sn %A5Init=Main <del>
- "{Libraries}"Stubs.o <del>
- "{CLibraries}"CRuntime.o <del>
- "{CLibraries}"StdCLib.o <del>
- "{CLibraries}"CInterface.o <del>
- "{Libraries}"Interface.o <del>
- "{Libraries}"ToolLibs.o <del>
- -o M4
-
- MC68000 Linker - v. 3.0 Release 1-Nov-1988 Start: 11:06:05 PM
- 3/23/92
-
- Copyright Apple Computer, Inc. 1985-1988
- All Rights Reserved.
-
- Reading files:
- File: 1 ":ObjFolder:m4.c.o"
- File: 2 ":ObjFolder:input.c.o"
- File: 3 ":ObjFolder:output.c.o"
- File: 4 ":ObjFolder:symtab.c.o"
- File: 5 ":ObjFolder:builtin.c.o"
- File: 6 ":ObjFolder:macro.c.o"
- File: 7 ":ObjFolder:debug.c.o"
- File: 8 ":ObjFolder:eval.c.o"
- File: 9 ":ObjFolder:path.c.o"
- File: 10 ":ObjFolder:format.c.o"
- File: 11 ":ObjFolder:regex.c.o"
- File: 12 ":ObjFolder:obstack.c.o"
- File: 13 ":ObjFolder:getopt.c.o"
- File: 14 ":ObjFolder:getopt1.c.o"
- File: 15 ":ObjFolder:alloca.c.o"
- File: 16 "HD105:MPW:Libraries:Libraries:Stubs.o"
- File: 17 "HD105:MPW:Libraries:CLibraries:CRuntime.o"
- File: 18 "HD105:MPW:Libraries:CLibraries:StdCLib.o"
- File: 19 "HD105:MPW:Libraries:CLibraries:CInterface.o"
- File: 20 "HD105:MPW:Libraries:Libraries:Interface.o"
- File: 21 "HD105:MPW:Libraries:Libraries:ToolLibs.o"
- Doing active analysis.
- Max. depth of search: 22
- Size of global data area: 7952
-
- Input summary:
- Read Max Bytes
- 1388 Strings
- 13 Str Blks 26702
- 1771 65535 Symbols 99176
- 37 ID-Sym Blks 37888
- 21 Files
- 9 Segments
- 1731 Modules
- 2408 65535 Ref. Lists 28896
- Total bytes: 192662
-
- 739 active and 68 visible entries of 1731 read.
- 3 segments, 68 Jump Table entries.
- ### Link: Error: Jump Table Offset is out of range. (Error 50) CMain
- ### Link: Error: Jump Table Offset is out of range. (Error 50)__cleanup
- ### Link: Error: Jump Table Offset is out of range. (Error 50) sig_dfl
- ### Link: Error: Jump Table Offset is out of range. (Error 50)_coreIOExit
- ### Link: Error: Jump Table Offset is out of range. (Error 50) raise
- ### Link: Errors prevented normal completion.
- There were 5 errors.
- Execution required 9 seconds.
- - --
- ;; *****************************************************
- ;; * Haydn Huntley huntley@copper.ucs.indiana.edu *
- ;; *****************************************************
-
- +++++++++++++++++++++++++++
-
- From: ksand@apple.com (Kent Sandvik)
- Date: 2 Apr 92 02:25:06 GMT
- Organization: MacDTS Mongols
-
- In article <1992Mar23.234054.21706@news.cs.indiana.edu>,
- huntley@garbo.cs.indiana.edu (Haydn Huntley) writes:
- >
- >
- > I'm trying to compile the GNU version of the M4 macro processor for
- > MPW C as an MPW tool, and I've gotten all of the files to compile, but
- > I can't get them to link, because I keep getting "Error: Jump Table
- > Offset is out of range". Can anyone help me?
- >
- > BTW, I'm using MPW 3.0, rather than the latest version, if that makes
- > a difference. Any and *all* help will be *greatly* appreciated! :-)
-
- It seems to be one of the classical cases where 16-bit offsets
- are not enough for the linking. You are using MPW 3.0, so model
- far support is out of the question. My suggestion would be to either
- change the linked library ordering, which maybe would make it suddenly
- possible to call functions within 16-bit offsets, or then do some
- creative segmentation and move functions around so they call each
- other inside the same segment (i.e. no need for a jump table entry).
-
- Hope this helps...
-
- Kent
- - --
- Kent Sandvik/DTS - Dynamic Language Evangelist.
- Opinions expressed are not private, and not owned by any company,
- organization or group. Happy happy, joy joy!
-
- ---------------------------
-
- From: chrille@zelator.in-berlin.de (Christian Kuss)
- Subject: Passwords with ModalDialog
- Date: 25 Mar 92 10:10:29 GMT
- Organization: Puplic-Access-Xenix-System
-
- Hello...
- I've got a problem. I'm writing a small program which asks for a password.
- I use the ModalDialog call with a Filterproc to replace the characters in
- the EventRecord.Message with an '*'. All works fine, but I can't read the
- text with GetIText, there are only '*'. So I use another string to save all
- typed characters, but when the user edits with the mouse or arrow keys, my
- string is wrong.
- How would you write such a filterproc?
-
- Chrille
-
- - --
-
-
- +------------------------------+--------------------------+
- ! chrille@zelator.in-berlin.de ! Voice: 0049 30 403 43 54 !
- ! c.kuss@telemail.zer ! Fax : 0049 30 402 58 93 !
- +------------------------------+--------------------------+
-
- +++++++++++++++++++++++++++
-
- From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
- Organization: University of Illinois at Urbana
- Date: Wed, 25 Mar 1992 14:06:36 GMT
-
- chrille@zelator.in-berlin.de (Christian Kuss) writes:
-
- >Hello...
- >I've got a problem. I'm writing a small program which asks for a password.
- >I use the ModalDialog call with a Filterproc to replace the characters in
- >the EventRecord.Message with an '*'. All works fine, but I can't read the
- >text with GetIText, there are only '*'. So I use another string to save all
- >typed characters, but when the user edits with the mouse or arrow keys, my
- >string is wrong.
- >How would you write such a filterproc?
-
- There's a "snippet" on ftp.apple.com which contains 3 ways to deal with the
- problem. I forget which month contains it.
-
- >Chrille
-
- >--
-
-
- >+------------------------------+--------------------------+
- >! chrille@zelator.in-berlin.de ! Voice: 0049 30 403 43 54 !
- >! c.kuss@telemail.zer ! Fax : 0049 30 402 58 93 !
- >+------------------------------+--------------------------+
- - --
- Mark Lanett, Software Tools Group, NCSA mlanett@uiuc.edu or NCSA.STG
- "People wander in and out of virtual rooms in virtual settings with virtual
- characters and virtual money and virtual armor and virtual weapons, which is
- virtually a good way to spend time, but not quite." -- Usenet Oracle
-
- +++++++++++++++++++++++++++
-
- From: dweisman@umiami.ir.miami.edu
- Date: 25 Mar 92 17:24:12 EST
- Organization: Univ of Miami IR
-
- In article <ZXN1PDT@zelator.in-berlin.de>, chrille@zelator.in-berlin.de (Christian Kuss) writes:
- > Hello...
- > I've got a problem. I'm writing a small program which asks for a password.
- > I use the ModalDialog call with a Filterproc to replace the characters in
- > the EventRecord.Message with an '*'. All works fine, but I can't read the
- > text with GetIText, there are only '*'. So I use another string to save all
- > typed characters, but when the user edits with the mouse or arrow keys, my
- > string is wrong.
- > How would you write such a filterproc?
- >
- > Chrille
-
- I would suggest not allowing editing. There really isn't a need to edit a
- password when you type it in. Just allow them to use the delete key to erase
- the previous character (that's easy to implement; just shorten the string by a
- character). You don't even have to use TextEdit.
- The alternative would be to do what the Sharing Setup control panel does with
- passwords. Use TextEdit normally to enter the password (no *'s) and then when
- they close the dialog, it will reopen with the *'s there.
- I would recommend the former suggestion more highly.
-
- Dan
-
- /-------------------------------------------------------------------------\
- | Dan Weisman - University of Miami - Florida | || || || || |
- |--------------------------------------------------| || || ||\ /|| |
- | INTERNET -----> dweisman@umiami.IR.Miami.edu | || || || | || |
- | BITNET -----> dweisman@umiami | ||||||| || | || |
- |-------------------------------------------------------------------------|
- | "Think for yourself and feel the walls become sand beneath your feet" |
- | -Queensryche, "Anybody Listening" |
- \_________________________________________________________________________/
-
- +++++++++++++++++++++++++++
-
- From: jack@umbio.med.miami.edu (Jack Herrington)
- Date: 26 Mar 92 14:27:28 GMT
- Organization: University of Miami Medical School
-
- chrille@zelator.in-berlin.de (Christian Kuss) writes:
- >I've got a problem. I'm writing a small program which asks for a password.
- >I use the ModalDialog call with a Filterproc to replace the characters in
- >the EventRecord.Message with an '*'. All works fine, but I can't read the
- >text with GetIText, there are only '*'. So I use another string to save all
- >typed characters, but when the user edits with the mouse or arrow keys, my
- >string is wrong.
- >How would you write such a filterproc?
-
- Right off the top, how about changing the editText to a userItem, handling
- the editing yourself (just use TE), then using a font with only bubbles
- (or whatever) as the editing font, and restricting characters to a known
- set. Viola!
-
- Just keep the font as a resource inside your application.
-
- This avoids all hacking work-arounds, since 'TE' is standard, userItems are
- standard, and fonts are standard. I think you can even use resedit to create
- the font.
- - --
- "Electric word 'life', it means forever and that's a might long time. But I'm
- here to tell yah, there's something else... The after-life, a word of
- never-ending happiness, you can always see the sun, day or night. So when you
- call up that shrink in Beverly hills, you know the one, Dr. everything-we-all-
-
- +++++++++++++++++++++++++++
-
- Organization: Queen's University at Kingston
- Date: Friday, 27 Mar 1992 23:29:12 EST
- From: <CHARLESW@QUCDN.QueensU.CA>
-
- There was an article in MacTutor (hmm, about a year ago?) that did this.
- Instead of using a substitute font, they used an off-window TE item, and
- shadowed everything in the on-window item but with bullets. Nice, simple,
- works.
-
- I just looked it up. The article was in the July/91 MacTutor, and was
- written by Bill Schilit.
-
- .../dave Dave Charlesworth
-
- +++++++++++++++++++++++++++
-
- From: CXT105@psuvm.psu.edu (Christopher Huckabay Modeller Tate)
- Date: 31 Mar 92 00:29:17 GMT
- Organization: Penn State University
-
- Hmmm. I don't *like* the shadowing of bullets.
-
- Sure, it proves that the machine is actually watching what you type, but
- it also shows the chap looking over my shoulder how many characters are in
- my password.
-
- Printing spaces instead of bullets should move the insertion point to the
- right (demonstrating that the machine is indeed paying attention), but make
- it much harder for an "eaveslooker" to tell how many keys you've pressed.
-
- - -------
- Christopher Tate | Cryptogram #9:
- cxt105@psuvm.psu.edu |
- CXT105@PSUVM.BITNET | EM DECY NYLBF LBB RZUAIF, DNYA
- - ---------------------------------| RNP IZYF DNY XYBBP XUDDZA FDLP
- Send me the answer; I love mail! | DNY FLCY?
-
- +++++++++++++++++++++++++++
-
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Organization: Kalamazoo College
- Date: Tue, 31 Mar 1992 13:05:05 GMT
-
- CXT105@psuvm.psu.edu (Christopher Huckabay Modeller Tate) writes:
- >I don't *like* the shadowing of bullets.
- >
- >Sure, it proves that the machine is actually watching what you type, but
- >it also shows the chap looking over my shoulder how many characters are in
- >my password.
- >
- >Printing spaces instead of bullets should move the insertion point to the
- >right (demonstrating that the machine is indeed paying attention), but make
- >it much harder for an "eaveslooker" to tell how many keys you've pressed.
-
- Just because security is a concern doesn't mean you have to have a
- mysterious user interface. How about randomly printing one to three
- bullets per character typed? (And remembering how many per char, of
- course, when the user backspaces.)
- - --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
-
- +++++++++++++++++++++++++++
-
- Organization: Queen's University at Kingston
- Date: Wednesday, 1 Apr 1992 23:49:10 EST
- From: <CHARLESW@QUCDN.QueensU.CA>
-
- Re: Echoing bullets for keystrokes as a security risk
-
- My feeling is that this is not a major risk. (People writing down passwords
- somewhere near or even on (yes on!) their machines is a bigger risk in my
- experience.) For example, I'm happy to tell you my password is 8 characters.
- I'll even throw in a big bonus hint: it's not a normal English word. Now
- remember, you have to type each guess into a dialog... (and maybe the dialog
- starts evasion tactics after 10 bad guesses...)
-
- Cheers,
-
- .../dave Dave Charlesworth
-
- +++++++++++++++++++++++++++
-
- From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
- Date: 2 Apr 92 02:41:00 GMT
- Organization: MacDTS, Apple Computer
-
- In article <ZXN1PDT@zelator.in-berlin.de>, chrille@zelator.in-berlin.de (Christian Kuss) writes:
- > Hello...
- > I've got a problem. I'm writing a small program which asks for a password.
- > I use the ModalDialog call with a Filterproc to replace the characters in
- > the EventRecord.Message with an '*'. All works fine, but I can't read the
- > text with GetIText, there are only '*'. So I use another string to save all
- > typed characters, but when the user edits with the mouse or arrow keys, my
- > string is wrong.
- > How would you write such a filterproc?
- >
- > Chrille
-
- Check out my Password sample code snippet, available from ftp.apple.com in:
- /dts/mac/sc/snippets/toolbox.iac/other/password.hqx
- (apparently somebody went overboard with the whole directories thing). It
- shows three different ways to implement a password dialog, each of which
- allows complete editing.
-
- Tim Dierks
- MacDTS, but I like it anyway (MB, take note)
-
- ---------------------------
-
- From: marten@uidesign.se (Marten Sorliden)
- Subject: Launch App & Doc
- Date: 25 Mar 92 11:02:01 GMT
- Organization: UI Design AB, Linkoping, Sweden
-
-
- I am writing an application able to launch other applications. I use the
- function LaunchApplication in the Process Manager, Inside Macintosh,
- Volume VI. This works fine. However, I want to launch applications and make
- them open a specific document, or just open the document if the application
- already is running.
-
- The LaunchParamBlockRec used by the function LaunchApplication has got a
- parameter, launchAppParametrs, which should be used as an optional pointer to
- a high-level event, which is sent as the first event to the application.
- My intention was to use this parameter. I created an Apple event whith the
- Event ID, kAEOpenDocumetns and containing the information of the document to
- be opened. But how do I convert the Apple Event to a regular high-level event
- so launchAppParametrs can point to it?
-
- I have also considerd the use of other methods to launch applications and to
- make other applications open documents. Technical Note #126 discusses how to
- call _Launch. But it seems to be a unsafe way since the _Launch trap is a
- subject of change. The AppleEvents, High-level events and the Process Manager
- on the other hand are not supported by old applications.
-
- I'm working in THINK C 5.0
-
- Any help would be appreciated.
-
- Thanks,
-
- . _
- Marten Sorliden
-
- - --
-
- Internet: marten@uidesign.se
-
- +++++++++++++++++++++++++++
-
- From: Joe.Francis@dartmouth.edu (Joe Francis)
- Date: 26 Mar 92 04:09:03 GMT
- Organization: Dartmouth College, Hanover, NH
-
- Apple has some "Snippets" code to do exactly what you describe.
- Snippets may be anonymously ftp'd from on ftp.apple.com. They can also
- be found on the ETO CD, should you be an ETO subscriber, and I believe
- they are also on the Developer CD, which you receive if you are a
- registered developer or have a DEVELOP magazine subscription.
-
- +++++++++++++++++++++++++++
-
- From: ross@bnr.ca (Ross Brown)
- Date: 26 Mar 92 01:34:13 GMT
- Organization: Bell-Northern Research
-
- In article <162@bladerunner.uidesign.se> marten@uidesign.se (Marten Sorliden)
- writes:
- >
- >I am writing an application able to launch other applications. I use the
- >function LaunchApplication in the Process Manager, Inside Macintosh,
- >Volume VI. This works fine. However, I want to launch applications and make
- >them open a specific document, or just open the document if the application
- >already is running.
- >[stuff deleted]
-
- I think what you need (in System 7, anyway) is the 'sope' Finder AppleEvent.
-
- Ross Brown
- Bell-Northern Research Ltd.
- Ottawa, Ontario, Canada
- ross@bnr.ca
- Opinions expressed do not necessarily represent those of BNR.
-
- +++++++++++++++++++++++++++
-
- From: anders@verity.com (Anders Wallgren)
- Date: 26 Mar 92 01:27:20 GMT
- Organization: Verity, Inc., Mountain View, CA
-
- What you need to do is coerce your event:
-
- AECoerceDesc(&theEvent, typeAppParameters, &launchDesc);
-
- You can look at the LaunchWithDoc snippet from DTS for more details.
-
- anders
-
- ---------------------------
-
- From: kamprath@hellfire.engin.umich.edu (Michael Fredric Kamprath)
- Subject: Increasing an application's heap size
- Date: 27 Mar 92 22:27:57 GMT
- Organization: University of Michigan Engineering, Ann Arbor
-
-
-
- How can I increase my applications's heap (using Think C 4.0.5).
- Presently, the command:
-
- curAvailSize = MaxMem(&totalAvailSize);
-
- returns curAvailSize ~6000 bytes and totalAvailSize ~4000000 bytes.
- I am not really clear on how to increase curAvailSize any large.
- If it is not possible for the application's heap to be increased, how
- do I create an extra heap outside of the program's memory for use, and
- access by, pointers?
-
- Thanks for any help!!!
-
- Michael Kamprath
- kamprath@caen.engin.umich.edu
- - --
- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
- \ | /
- / Michael Fredric Kamprath | \
- / kamprath@caen.engin.umich.edu | \
- \ | /
- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
-
- +++++++++++++++++++++++++++
-
- From: mauser@intercon.com (Richard Chandler)
- Date: 31 Mar 92 18:24:25 GMT
- Organization: InterCon Systems Corporation
-
- In article <RSd+fY-@engin.umich.edu>, kamprath@hellfire.engin.umich.edu
- (Michael Fredric Kamprath) writes:
- > How can I increase my applications's heap (using Think C 4.0.5).
- > Presently, the command:
- >
- > curAvailSize = MaxMem(&totalAvailSize);
- >
- > returns curAvailSize ~6000 bytes and totalAvailSize ~4000000 bytes.
- > I am not really clear on how to increase curAvailSize any large.
- > If it is not possible for the application's heap to be increased, how
- > do I create an extra heap outside of the program's memory for use, and
- > access by, pointers?
-
- Call MaxApplZone after you've initialized all the toolbox stuff.
-
- > Thanks for any help!!!
-
- You're welcome.
-
- - --
- People are more violently opposed to fur than leather, because it's safer to
- harass rich women than biker gangs.
- "Ride a motorcycle. Save Gas, Oil, Rubber, Steel, Aluminum, Parking Spaces,
- The Environment, and Money. Plus, you get to wear all the leather you want!"
- Rich Chandler, DoD #296
-
- +++++++++++++++++++++++++++
-
- From: bear@harlqn.co.uk (Andy Edwards)
- Date: 2 Apr 92 14:07:37 GMT
- Organization: Harlequin Limited, Cambridge, England
-
-
- Hi,
-
- >>How can I increase my applications's heap (using Think C 4.0.5).
- >>Presently, the command:
- >>
- >> curAvailSize = MaxMem(&totalAvailSize);
- >>
- >>returns curAvailSize ~6000 bytes and totalAvailSize ~4000000 bytes.
- >>I am not really clear on how to increase curAvailSize any large.
-
- Try MaxApplZone() ; this should expand the heap.
-
- >>If it is not possible for the application's heap to be increased, how
- >>do I create an extra heap outside of the program's memory for use, and
- >>access by, pointers?
-
- There are some new traps in MultiFinder/ System 7 which allow you to
- allocate "multifinder temporary memory", there are pointer & handle
- allocate/dispose call variants. I believe that you can't hold this
- memory across WaitNextEvent calls, only allocate & free it between
- WaitNextEvent calls. A good used of MF temporary memory is when you
- are grief stricken by a shortage of memory.
-
- >>Thanks for any help!!!
- >>
- >>Michael Kamprath
- >>kamprath@caen.engin.umich.edu
-
- +--: Andy Edwards :----------*=================*------------------------------+
- | Macintosh fire fighter, | Harlequin Ltd. | uucp: bear@harlqn.uucp |
- | deity, PostScript language | Barrington Hall | janet: bear@uk.co.harlqn |
- | level 2 porter and PAP | Barrington | applelink: harlequin |
- | server clone originator. | Cambridge | voice: 0223 872522 |
- | | CB2 5RG | +44-223-872-522 |
- | My opinions only. | England | fax: 0223 872519 |
- +----------------------------*=================*------------------------------+
-
- ---------------------------
-
- From: Jeremiah.Blatz@dartmouth.edu (Jeremiah Blatz)
- Subject: No, I'm Not Programming Graphics & Sound, I'm Playing
- Date: 31 Mar 92 03:46:29 GMT
- Organization: Dartmouth College, Hanover, NH
-
- >No matter what I try, I cannot seem to get the Sound Manager to
- >play asynchronous sound without generating spurious interrupts.
-
- Are you using the sound manager, or the sound driver? The manager is
- sys. 7 compatible, the driver is good at playing aweful staticy stuff
- under sys. 7.
-
- > It is mistaken to think that System 6.0.5 is stable and that one
- >should develop for the lowest decent denominator?
-
- System 7.0 is the most stable System version I've ever used. An app
- I'm writing to be as "System 7 saavy" (arrrrgh!) as possible runs fine
- on a 512 (no "E") and system 4.2 or something.
-
- Just a stupid question (flame if ya like), but have you checked the
- Tech. Notes? I-Mac vol VI?
-
- Jeremiah
- JerBl@Dartmouth.edu
- The opinions expressed are mine only and not those of Dartmouth
- College, Apple Computer, Santa and/or Satan, any of his elves, Jimmy
- Swaggart, Dan Quayle, Bill Gates, or anyone you know.
-
- +++++++++++++++++++++++++++
-
- From: orpheus@reed.edu (P. Hawthorne)
- Date: 2 Apr 92 07:46:36 GMT
- Organization: Reed College, Portland OR
-
-
- Jeremiah.Blatz@dartmouth.edu (Jeremiah Blatz) writes:
- . Are you using the sound manager, or the sound driver?
-
- The Sound Manager under 6.0.5, which is apparently a seething ferment of
- interesting behavior, while being much more tame than previous versions...
- I guess the lowest common denominator is going to be 6.0.7, but under
- the tacit assumption that the users who care would stick with the 6.0.5.
- print drivers. Since the seminal 32-Bit QD 1.2 merely required 6.0.5., I
- had hoped to fully support graphics and sound under that system version.
- C'est la vie.
-
-
- . System 7.0 is the most stable System version I've ever used. An app
- . I'm writing to be as "System 7 saavy" (arrrrgh!) as possible runs fine
- . on a 512 (no "E") and system 4.2 or something.
-
- That's really cool! This might sound uppity, and I hope that you don't
- take it that way, but how easily replicated is your project? I mean, how
- hard is it to plug and play a different application with that code? Are you
- encoding in a resource what particulars are required for the app?
- To be sure, 7 is the neatest thing since sliced bread. However, it is
- not the perfect system for everyone, even if they have modern hardware.
- With a fairly large segment of the people that run in my circles, an
- admittedly insular list of beta testers and amiably curious colleagues, 7
- gets a worse rap than a passle of inits whose names begin with spaces.
-
-
- . Just a stupid question (flame if ya like), but have you checked the
- . Tech. Notes? I-Mac vol VI?
-
- Oh, how could anyone flame another for suggesting that?
- And yes, actually I have. I try to exhaust all other resources before
- posting to the net...
-
- Theus (orpheus@reed.edu)
-
- ---------------------------
-
- From: nessett@llnl.gov (Danny M. Nessett)
- Subject: MPW shell script parameter manipulation
- Date: 31 Mar 92 16:56:50 GMT
- Organization: LLNL
-
- I am a novice MPW shell script programmer with the following problem. I need
- to write a schell script that accepts a fully specified filename and from
- that parameter sets a shell variable to the directory in which the filename
- resides. This shell variable will be used in the remainder of the shell
- script. I've looked at the MPW programming manual, but have not found a way
- that this can be done. Does anyone know if this is possible with shell
- commands? If not, is there some other way I can accomplish the same thing?
- Thanks for any help.
-
- Regards,
-
- Dan Nessett
-
- +++++++++++++++++++++++++++
-
- From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
- Date: 31 Mar 92 18:30:14 GMT
- Organization: University of Illinois at Urbana
-
- nessett@llnl.gov (Danny M. Nessett) writes:
-
- >I am a novice MPW shell script programmer with the following problem. I need
- >to write a schell script that accepts a fully specified filename and from
- >that parameter sets a shell variable to the directory in which the filename
- >resides. This shell variable will be used in the remainder of the shell
- >script. I've looked at the MPW programming manual, but have not found a way
- >that this can be done. Does anyone know if this is possible with shell
- >commands? If not, is there some other way I can accomplish the same thing?
- >Thanks for any help.
-
- #if StupidMPWTricks
- Welcome to the wonderfull world of MPW! Here you discover a language
- which lets you pass parameters to a script executing in its own
- environment, or execute a script in its parent's environment, but not
- pass parameters to a script executing in its parent's environment!
- #endif
-
- That is: (where foo is a script)
- foo bar # passes "bar" to script but foo can't set my environment
- execute foo # foo is running in my environment but...
- execute foo bar # doesn't work. Actually it does but execute _explicitly_
- # ignores parameters, so the "bar" dissapears.
-
- I say just do a:
- set FOOPARAM bar
- execute betterfoo # betterfoo looks in FOOPARAM and sees "bar"
-
- or make foo an alias...
- - --
- Mark Lanett, Software Tools Group, NCSA mlanett@uiuc.edu or NCSA.STG
- "People wander in and out of virtual rooms in virtual settings with virtual
- characters and virtual money and virtual armor and virtual weapons, which is
- virtually a good way to spend time, but not quite." -- Usenet Oracle
-
- +++++++++++++++++++++++++++
-
- From: tjc@pacvax.UUCP (Tom Colley)
- Date: 1 Apr 92 14:50:19 GMT
- Organization: Pacer Software Inc., Westborough, MA USA
-
- In article <121428@lll-winken.LLNL.GOV> nessett@llnl.gov (Danny M. Nessett) writes:
- >I am a novice MPW shell script programmer with the following problem. I need
- >to write a schell script that accepts a fully specified filename and from
- >that parameter sets a shell variable to the directory in which the filename
- >resides. This shell variable will be used in the remainder of the shell
- >script. I've looked at the MPW programming manual, but have not found a way
- >that this can be done. Does anyone know if this is possible with shell
- >commands? If not, is there some other way I can accomplish the same thing?
- >Thanks for any help.
- >
- >Regards,
- >
- >Dan Nessett
-
- If I understand you correctly, you want to take an argument to a script,
- and from that argument, strip off the directory portion of that
- argument.
-
- For the following script segment, in MPW, convert:
- R to option-r, L to option-l (lowercase L), X to option-x
-
- ### this assumes that the argument to be played with is the first arg.
-
- Unset R1
- ( Evaluate "{1}" =~ /(([L:]*:)*)R1X/ ) > Dev:Null
- Set file_path "{R1}"
- echo "{file_path}"
-
- Unset R1
- ( Evaluate "{1}" =~ /(([L:]*:)*)(X)R1/ ) > Dev:Null
- Set leaf_name "{R1}"
- echo "{leaf_name}"
-
- ### This is essentially taken from the MPW docs on the Evaluate command
- ### (pg 144 of vol 2 of the MPW 3.0 docs).
-
- Hope this helps,
-
- Tom Colley
- tjc@pacersoft.com tjc%pacvax@uunet.uu.net
- ##watch my return address, it may be wrong
-
- ---------------------------
-
- From: roland@dna.lth.se (Roland Mansson)
- Subject: SUMMARY: Hotels in San Jose / WWDC in May
- Date: 30 Mar 92 12:08:10 GMT
- Organization: Lund University Computing Center, Sweden
-
- I asked:
- >I'm going to the Worldwide Developers Conference in San Jose in May. Since
- >the conference schedule is very busy, there won't be much time left to
- >spend in the room. Therefore I would like suggestions of an inexpensive hotel
- >located near San Jose Convention Center. Please answer by e-mail; I'll
- >summarize.
-
- The replies:
- From: engber@aristotle.ils.nwu.edu (Mike Engber)
- I was told the Holiday Inn Park Center Plaza for $89 a night - a special
- WWDC rat. Their number is 408-998-0400.
- I got this info from someone else, but he's a good guy and has been
- to the WWDC before. He says it's right across the street.
-
- From: sw@network-analysis-ltd.co.uk (Sak Wathanasin)
- I stayed in the Holiday Inn across the road from the Convention Centre.
- It was OK, and handy to nip back to dump all the freebies Apple handed out.
-
- Thanks to those who replied.
- - --
- Roland Mansson, Lund University Computing Center, Box 783, S220 07 Lund, Sweden
- Phone: +46-46107436 Fax: +46-46138225 Bitnet: roland_m@seldc52
- Internet: roland.mansson@ldc.lu.se or roland.mansson%ldc.lu.se@uunet.uu.net
- UUCP: {uunet,mcvax}!sunic!ldc.lu.se!roland.mansson AppleLink: SW0472
-
- +++++++++++++++++++++++++++
-
- From: roland@dna.lth.se (Roland Mansson)
- Date: 1 Apr 92 09:36:59 GMT
- Organization: Lund University Computing Center, Sweden
-
- I got this directly from Apple:
-
- From: DEV.EVENTS Developer Events
- Sub: 1992 WWDC hotel information
-
- We have made arrangements for discount rates at the following hotels. Be sure
- to mention the conference when booking your room to receive these discount
- rates.
-
- The Fairmont Hotel $138/single
- 170 S. Market Street $158/double
- San Jose, CA
- 800/527-4727 (in the U.S. and Canada ONLY)
- 408/998-1900 (for all other countries)
- Note: The Fairmont Hotel is #1 in luxury.
- AppleLink workstations will be available in a special meeting room at the
- Fairmont 24 hours a day.
-
- The Hyatt San Jose $109/single
- 1740 N. First Street $134/double
- San Jose, CA
- 800/233-1234 (in the U.S. and Canada ONLY)
- 408/993-1234 (for all other countries)
- NOTE: If you choose to stay here, you will have to take
- the Light Rail to get to the Convention Center.
-
- Red Lion Hotel $115/single
- 2050 Gateway Place $115/double
- San Jose, CA
- 800/547-8010 (in the U.S. and Canada ONLY)
- 408/453-4000 (for all other countries)
- NOTE: Walk to First Street and take the Light Rail to the Convention
- Center (a 10 minute ride).
-
-
- Hotel De Anza $120/single
- 233 W. Santa Clara Street
- San Jose, CA
- 800/843-3700 (in the U.S. and Canada ONLY)
- 408/286-1000 (for all other countries)
- NOTE: 4 blocks away, a five minute walk to the Convention Center.
-
- Holiday Inn Airport $77/single
- 1355 N. the Street $77/double
- San Jose, CA
- 800/465-4329 (in the U.S. and Canada ONLY)
- 408/453-5340 (for all other countries)
- NOTE: If you choose to stay here, you will have to take
- the Light Rail to get to the Convention Center (a 10 minute ride).
- It is #1 in price.
-
- Holiday Inn, Park Center Plaza $89/single
- 282 Almaden Blvd. $89/double
- San Jose, CA
- 800/465-4329 (in the U.S. and Canada ONLY)
- 408/998-0400 (for all other countries)
- NOTE: Holiday Inn is located across the street from the
- San Jose Convention Center.
-
- Bed & Breakfast Inns
- NOTE: We don`t have discount rates at the following
- Bed & breakfast Inns. This is just in case someone wants to stay at
- a Bed & Breakfast Inn.
-
- The Hensley House $75 - 100/double
- 456 North 3rd Street
- San Jose, CA
- 408/298-3537
- NOTE: Walk a block, take the Light Rail at the Eyer station on First Street
- (a 10 minute ride).
-
- Briar Rose $65/shared bath
- 897 Jackson Street $70 - 85/private bath
- San Jose, CA $120/private cottage
- 408/279-5999
- NOTE: Either a 45 minute walk, a 5 minute drive, or take Santa Clara County
- Transit's bus 62 from First Street.
-
- If you have any other questions, please link me at DEV.EVENTS or call
- (408)974-4897.
-
- Nancy Carr
- Apple Developer Events
-
-
-
- - --
- Roland Mansson, Lund University Computing Center, Box 783, S220 07 Lund, Sweden
- Phone: +46-46107436 Fax: +46-46138225 Bitnet: roland_m@seldc52
- Internet: roland.mansson@ldc.lu.se or roland.mansson%ldc.lu.se@uunet.uu.net
- UUCP: {uunet,mcvax}!sunic!ldc.lu.se!roland.mansson AppleLink: SW0472
-
- ---------------------------
-
- From: bruss@cs.ucsd.edu (Brian Russ)
- Subject: Dialog/Think C Questions
- Date: 31 Mar 92 23:32:59 GMT
- Organization: =CSE Dept., U.C. San Diego
-
-
- I'm implementing a (modeless) dialog box with several editText
- fields, and I've some questions ...
-
- (1) Hitting the RETURN key inside a text field blanks out the
- text -- the text is still there (if I go to another field and back
- to the first, I can find the text), but it's temporarily erased.
- Any ideas on why this might be happening?
-
- (2) The TAB key is supposed to allow auto-advancement from one
- field to the next -- the problem is that I sometimes need to move
- to a field that's different that the "next" one in the item list.
- So what I really need is a way to arbitrarily choose any editText
- item as the current one accepting input -- ideas?
-
- FYI, I'm very new to Think C and the Mac, but am very familiar
- with C itself. I'm doing all this on a IIsi, System 7 ...
-
- Thanks for your help ...
-
- Brian
- - --
- Brian Russ
- CSE Department, UC San Diego
- ..!sdcsvax!bruss bruss@beowulf.ucsd.edu
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
- Date: 1 Apr 92 21:19:38 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- > bruss@cs.ucsd.edu (Brian Russ) writes:
-
- (1) Hitting the RETURN key inside a text field blanks out the
- text -- the text is still there (if I go to another field and back
- to the first, I can find the text), but it's temporarily erased.
- Any ideas on why this might be happening?
-
- Yes, you're entering a return (aka line break) which makes the
- edit text auto-scroll. Since it's only one line...
-
- You could use a dialog event filter to catch returns.
-
- The same thing goes for selecting fields; you could catch
- the tab key and do whatever you want.
-
- - --
- h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
-
- ---------------------------
-
- End of C.S.M.P. Digest
- **********************
-